package dataStructure.xmg2.a01;

/**
 * @author: vince_zww
 * @date: 2022/1/9 10:48
 * @desceription:
 */
public class BubbleSort1<E extends Comparable<E>> extends Sort<E> {

    @Override
    protected void sort() {
        for (int end = array.length; end > 0; end--) {
            for (int begin = 1; begin <= end; begin++) {
                if (cmp(begin, begin - 1) < 0) {
                    swap(begin, begin - 1);
                }
            }
        }
    }
}
